package pt.mleiria.saf;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class Lixo {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		final String linha = "05 Feb 2013 10:59:46,924 GMT+0000 § INFO  § [com.multicert.projects.saf.validation]  § (http-saf%2F192.168.170.89-8080-4) § [192.168.170.33] § VALIDAR Mensagem (2013-02-05 10:59:46.644): <C101;00;20130205110233;0365577178;0602;2;;;;000003975434;5016490100004138;1601;>, Resposta (2013-02-05 10:59:46.924): <C201;00;20130205105946;0365577178;00;01340>";
				
		Pattern pattern = Pattern.compile("<C101.+;>");
		Matcher matcher = pattern.matcher(linha);
	    // Check all occurance
	    while (matcher.find()) {
	      System.out.print("Start index: " + matcher.start());
	      System.out.print(" End index: " + matcher.end() + " ");
	      String c101 = matcher.group().substring(1, matcher.group().length()-1);
	      System.out.println(c101);
	      String[] splitter = c101.split(";");
	      System.out.println("SPLITTER-->" + splitter[0] + ";" + splitter[11]);
	    }
		
		

	}

}
